﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DataObjectTypeName="DatabaseComponent.Rules" DeleteMethod="Delete" 
            InsertMethod="Insert" onobjectcreated="ObjectDataSource1_ObjectCreated" 
            SelectMethod="Select" TypeName="DatabaseComponent.RulesDB" 
            UpdateMethod="Update">
            <SelectParameters>
                <asp:Parameter Name="strTop" Type="String" />
                <asp:Parameter Name="strWhere" Type="String" />
                <asp:Parameter Name="whereParams" Type="Object" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" 
        GridLines="None" DataKeyNames="ID">
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            <asp:BoundField DataField="RuleName" HeaderText="RuleName" 
                SortExpression="RuleName" />
            <asp:BoundField DataField="RuleNameEN" HeaderText="RuleNameEN" 
                SortExpression="RuleNameEN" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" CellSpacing="2" DataSourceID="ObjectDataSource1" Height="50px" 
        Width="125px">
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            <asp:BoundField DataField="RuleName" HeaderText="RuleName" 
                SortExpression="RuleName" />
            <asp:BoundField DataField="RuleNameEN" HeaderText="RuleNameEN" 
                SortExpression="RuleNameEN" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
    </asp:DetailsView>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        DataObjectTypeName="DatabaseComponent.Groups" DeleteMethod="Delete" 
        InsertMethod="Insert" onobjectcreated="ObjectDataSource2_ObjectCreated" 
        SelectMethod="Select" TypeName="DatabaseComponent.GroupsDB" 
        UpdateMethod="Update">
        <SelectParameters>
            <asp:Parameter Name="strTop" Type="String" />
            <asp:Parameter Name="strWhere" Type="String" />
            <asp:Parameter Name="whereParams" Type="Object" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="ObjectDataSource2" ForeColor="#333333" 
        GridLines="None" DataKeyNames="ID">
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            <asp:BoundField DataField="GroupNameAR" HeaderText="GroupNameAR" 
                SortExpression="GroupNameAR" />
            <asp:BoundField DataField="GroupNameEN" HeaderText="GroupNameEN" 
                SortExpression="GroupNameEN" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" 
        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" CellSpacing="2" DataSourceID="ObjectDataSource2" Height="50px" 
        Width="125px">
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            <asp:BoundField DataField="GroupNameAR" HeaderText="GroupNameAR" 
                SortExpression="GroupNameAR" />
            <asp:BoundField DataField="GroupNameEN" HeaderText="GroupNameEN" 
                SortExpression="GroupNameEN" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
    </asp:DetailsView>
    <br />
    <asp:DropDownList ID="DropDownList1" runat="server" 
        DataSourceID="ObjectDataSource2" DataTextField="GroupNameAR" 
        DataValueField="ID" AutoPostBack="true">
    </asp:DropDownList>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
        DataObjectTypeName="DatabaseComponent.GroupRules" DeleteMethod="Delete" 
        InsertMethod="Insert" onobjectcreated="ObjectDataSource3_ObjectCreated" 
        SelectMethod="getGroupRulesByGroupID" TypeName="DatabaseComponent.GroupRulesDB" 
        UpdateMethod="Update">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" DefaultValue="1" Name="GroupID" 
                PropertyName="SelectedValue" Type="Int64" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="ObjectDataSource3" ForeColor="#333333" 
        GridLines="None" DataKeyNames="ID">
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            
            
            <asp:BoundField DataField="GroupID" HeaderText="GroupID" 
                SortExpression="GroupID" />
            <asp:BoundField DataField="RuleID" HeaderText="RuleID" 
                SortExpression="RuleID" />
                
            <asp:TemplateField>
                <HeaderTemplate>
                    GroupName                
                </HeaderTemplate>
                <ItemTemplate>
                    <%# ((DatabaseComponent.Groups)Eval("objGroups")).GroupNameAR %>                
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    RuleName                
                </HeaderTemplate>
                <ItemTemplate>
                    <%# ((DatabaseComponent.Rules)Eval("objRules")).RuleName %>                
                </ItemTemplate>
            </asp:TemplateField>    
            
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:DetailsView ID="DetailsView3" runat="server" AutoGenerateRows="False" 
        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" CellSpacing="2" DataSourceID="ObjectDataSource3" Height="50px" 
        Width="125px">
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
            <asp:BoundField DataField="GroupID" HeaderText="GroupID" 
                SortExpression="GroupID" />
            <asp:BoundField DataField="RuleID" HeaderText="RuleID" 
                SortExpression="RuleID" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
    </asp:DetailsView>
    </form>
</body>
</html>
